﻿using DevExpress.Utils;
using DevTeam;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace ConfExpert.Forms.Planlama
{
    public partial class Invoice : XPopupForm
    {
        public Invoice(ref BindingSource bs)
        {
            InitializeComponent();
            InitGridView(gridView1, bs);
        }

        private void Fatura_Load(object sender, EventArgs e)
        {
            gridView1.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom;
            gridView1.BestFitColumns();
            foreach (string str in "PlanlamaLinesInvoiceId;PlanlamaLinesId".Split(';'))
                gridView1.Columns[str].Visible = false;

            gridView1.AddSummary("YuklenenAdet", "Yuklenen2Kalite");
            gridView1.RowCellStyle += new DevExpress.XtraGrid.Views.Grid.RowCellStyleEventHandler(gridView1_RowCellStyle);
            btnOK.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            //btnOK.Click += new EventHandler(btnOK_Click);
        }

        void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
        {
            if (e.RowHandle >= 0)
                if (e.Column.FieldName == "YuklenenAdet")
                    e.Appearance.Font = new Font(AppearanceObject.DefaultFont, FontStyle.Bold);
        }

        //void btnOK_Click(object sender, EventArgs e)
        //{
        //    throw new NotImplementedException();
        //}
    }
}